module Curriculum
  class Timetable < Curriculum::Base
    self.table_name = "timetables"
    belongs_to :store

    def to_timetable
      ::Timetable.new(
          slice(:id, :class_start_time, :class_end_time).merge(
              store_id: remote_store_id,
              classroom_id: remote_classroom_id,
              course_id: course.fetch("id"),
              coach_id: coach.fetch("id"),
              status: :released
          )
      )
    end
  end
end
